<template>
    <div style="padding: 30px">
        <my-card-title title="正在编辑的表单">
            <a-table :columns="columns" :dataSource="auditList">
                                    <span slot="formId" slot-scope="formId">
                                        <a :href="'http://localhost:9099/#/eventForm/'+formId"
                                           target="_blank">{{formId}}</a>
                                    </span>
                <span slot="customTitle">表单ID</span>
                <span slot="action" slot-scope="data">
                                        <a-popconfirm placement="topLeft"
                                                      okText="Yes"
                                                      cancelText="No"
                                                      @confirm="access(data.formId)">
                                            <div slot="title">
                                                确认通过这个表单吗？
                                            </div>
                                            <a>通过</a>
                                        </a-popconfirm>
                                        <a-divider type="vertical"/>
                                        <a href="javascript:;">拒绝</a>
                                        <a-divider type="vertical"/>
                                        <a href="javascript:;">删除</a>
                                    </span>
            </a-table>
        </my-card-title>
    </div>
</template>

<script>
    const columns = [
        {
            dataIndex: 'formId',
            key: 'formId',
            slots: {title: 'customTitle'},
            scopedSlots: {customRender: 'formId'},
        },
        {
            title: '报名用户',
            dataIndex: 'creator.userName',
            key: 'creator.userId',
        },
        {
            title: '报名用户邮箱',
            dataIndex: 'creator.userEmail',
            key: 'creator.userEmail',
        },
        {
            title: '报名提交时间',
            dataIndex: 'formCreateTime',
            key: 'formCreateTime',
        },
        {
            title: '操作',
            key: 'action',
            scopedSlots: {customRender: 'action'},
        },
    ];
    export default {
        name: 'Editing',
        data() {
            return {
                auditList: null,
                columns,
            };
        },
        created() {
            this.$apis.getEventForm(31, 'audit').then((data) => {
                this.auditList = data;
            });
        },
    };
</script>

<style scoped>

</style>
